﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace aQuery
{
    public class ActionQueue<T> where T : class
    {

        #region public members
        public T Target {get;set;}
        #endregion

        #region internal members
        internal Queue<ActionAtTarget<T>> Actions { get; set; }

        internal ActionQueue(T target)
        {
            this.Target = target;

            this.Actions = new Queue<ActionAtTarget<T>>();
        }

        internal ActionQueue<T> DequeueToExecute()
        {
            ActionAtTarget<T> action = Actions.Dequeue();
            action.Invoke(Target);
            return this;
        }
        #endregion

    }
}
